]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
Adapt to required CoglContext params
authorBilal Elmoussaoui <belmouss@redhat.com>
Sat, 29 Jun 2024 17:08:32 +0000 (19:08 +0200)
committerBilal Elmoussaoui <belmouss@redhat.com>
Mon, 15 Jul 2024 10:48:36 +0000 (12:48 +0200)
They used to retrieve it from a global variable which we are trying to
remove from mutter

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3402>

src/shell-global.c

index f5349e4097974d1ce788a9307290186eec062804..724534fb1af464a73b126cdb4856104da0925cd4 100644 (file)
@@ -908,10 +908,11 @@ global_stage_before_paint (gpointer data)
 }
 
 static gboolean
-load_gl_symbol (const char  *name,
-                void       **func)
+load_gl_symbol (CoglRenderer *renderer,
+                const char   *name,
+                void        **func)
 {
-  *func = cogl_get_proc_address (name);
+  *func = cogl_renderer_get_proc_address (renderer, name);
   if (!*func)
     {
       g_warning ("failed to resolve required GL symbol \"%s\"\n", name);
@@ -929,6 +930,11 @@ global_stage_after_paint (ClutterStage     *stage,
   /* At this point, we've finished all layout and painting, but haven't
    * actually flushed or swapped */
 
+  ClutterBackend *backend = clutter_get_default_backend ();
+  CoglContext *cogl_context = clutter_backend_get_cogl_context (backend);
+  CoglDisplay *cogl_display = cogl_context_get_display (cogl_context);
+  CoglRenderer *cogl_renderer = cogl_display_get_renderer (cogl_display);
+
   if (global->frame_timestamps && global->frame_finish_timestamp)
     {
       /* It's interesting to find out when the paint actually finishes
@@ -946,9 +952,9 @@ global_stage_after_paint (ClutterStage     *stage,
       static void (*finish) (void);
 
       if (!finish)
-        load_gl_symbol ("glFinish", (void **)&finish);
+        load_gl_symbol (cogl_renderer, "glFinish", (void **)&finish);
 
-      cogl_flush ();
+      cogl_context_flush (cogl_context);
       finish ();
 
       shell_perf_log_event (shell_perf_log_get_default (),